﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Domain.DAL;
using Domain.BLL;

namespace ComputerShopWebsite.Controllers
{
    public class ProductsController : Controller
    {
        //
        // GET: /Products/

        

        public ActionResult Index()
        {
            ProductBLL _product = new ProductBLL();
            //_product.ProductID = id;

            //_product.SingleRead();
            return View(_product.listAllProducts());
        }

        public ActionResult Details(int id = 0)
        {
            ProductBLL _p = new ProductBLL();
            _p.ProductID = id;

            _p.SingleRead();

            return View(_p);

        }
        public ActionResult Demo()
        {
            return View();
        }
        public ActionResult ProductByCategory(int CatId)
        {
            ProductBLL _product = new ProductBLL();
            return View(_product.ListProductByCategory(CatId));
        }






    }
}
